$(function () {
    $('#submit').click(function () {
        // alert(111);
        var user = {};
        user.nickname = $('#nickname').val();
        user.mobile = $('#mobile').val();
        user.birthday = $('#birthday').val();
        user.gender = $('#gender').val();
        user.psw = $('#psw').val();
        var formData = new FormData();
        formData.append("user",JSON.stringify(user));
        $.ajax({
            url:'/cinema/register',
            type:'post',
            data:formData,
            contentType:false,
            processData:false,
            cache:false,
            success:function (data) {
                if (data.success){
                    $.toast('提交成功！');
                    window.location.href = "/html/login.html";
                } else {
                    $.toast('提交失败！' + data.errMsg);
                }
            }
        });
    });
});